package framework.grid.data;
import framework.grid.GridAlgorithm;
import framework.util.PeerEdge;
import framework.util.PeerNode;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;



public class RemoteNodeMetaData extends UnicastRemoteObject implements IRemoteNodeMetaData {

	private PeerNode node;
	private PeerEdge[] edges = new PeerEdge[(GridAlgorithm.MAX_PATH_LENGTH+2)];

	public RemoteNodeMetaData() throws RemoteException{
		super();
	}
	
	
	@Override
	public void setNode(PeerNode node) {
		this.node = node;
	}

	@Override
	public PeerNode getNode() {
		return node;
	}
	@Override
	public PeerEdge getRef(int level) {
		return this.edges[level];
	}
	
	@Override
	public void setRef(int level, PeerEdge edge) {		
		this.edges[level]=edge;
	}
	
	@Override
	public PeerEdge[] getRefs() throws RemoteException {
		return this.edges;
	}

	@Override
	public void setRefs(PeerEdge[] edges) throws RemoteException {
		this.edges = edges;
	}
	


	@Override
	public String toString() {
		return this.node.toString();
	}
	
	
	
}
